package com.simple.security.controller;

import com.mmm.station.security.annotation.Power;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2016/12/10.
 */
@RestController
public class TestController {

    @RequestMapping(value = "")
    public Object index(){
        return "你好，欢迎进入首页";
    }


    /**
     * 基本路径的设置在application。properties中
     * @return
     */
    @RequestMapping(value = "task")
    public Object task(){
        return "已经认证可以访问";
    }


    /**
     * 权限的设置在myRealm中
     * @return
     */
    @RequestMapping(value = "role")
    @Power(needRole = "admin")
    public Object role(){
        return "有权限可以访问";
    }


}
